package com.tanhua.model.vo;

import com.tanhua.model.domain.Peachbossom;
import com.tanhua.model.domain.UserInfo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class PeachbossomVo {

    // 用户id
    private Long id;
    //用户头像
    private String avatar;
    //昵称
    private String nickname;
    //性别
    private String gender;
    //年龄
    private Integer age;
    // 语音地址
    private String soundUrl;
    //剩余次数
    private Integer remainingTimes;

    public static PeachbossomVo init (UserInfo userInfo , Peachbossom peachbossom,Integer count){
        PeachbossomVo vo = new PeachbossomVo();
        vo.setId(userInfo.getId());
        vo.setAvatar(userInfo.getAvatar());
        vo.setNickname(userInfo.getNickname());
        vo.setGender(userInfo.getGender());
        vo.setAge(userInfo.getAge());
        vo.setSoundUrl(peachbossom.getSoundUrl());
        vo.setRemainingTimes(count);
        return vo;
    }

}
